package com.base.common.persistent.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.base.common.persistent.model.Employee;
import com.base.common.persistent.model.Terminal;
import com.cjy.common.annotation.MyBatisRepository;

@MyBatisRepository
public interface EmployeeMapper {

	/**
	 * 根据手机号查询员工信息个数
	 * 
	 * @param phone
	 * @return
	 */
	public List<Employee> queryEmployeeByPhone(
			@Param(value = "phone") String phone);

	/**
	 * 员工登录
	 * 
	 * @param code
	 * @param phone
	 * @return
	 */
	public List employeeLogin(Terminal terminal);

	/**
	 * 根据员工id更新员工信息的终端外键
	 * 
	 * @param employeeId
	 * @param terminalId
	 * @return
	 */
	public int updateEmployeeTerminalInfoById(
			@Param(value = "employeeId") int employeeId,
			@Param(value = "terminalId") int terminalId);

	/**
	 * 根据id获取员工信息
	 * 
	 * @param employeeId
	 * @return
	 */
	public List<Employee> queryEmployeeAndPermissionById(
			@Param(value = "employeeId") int employeeId);

	/**
	 * 根据职位和小区id查询员工列表
	 * 
	 * @param employee
	 * @return
	 */
	public List<Employee> queryEmployeesByDeptAndCompoundsId(
			@Param(value = "dept") int dept,
			@Param(value = "compoundsId") int compoundsId);

	/**
	 * 根据id查询员工信息
	 * 
	 * @param id
	 * @return
	 */
	public Employee queryEmployeeById(@Param(value = "id") int id);

	/**
	 * 更新员工默认小区
	 * 
	 * @param employeeId
	 * @param compoundsId
	 * @return
	 */
	public int updateChooseDefaultCompounds(int employeeId, int compoundsId);

	/**
	 * 更新员工头像
	 * 
	 * @param employeeId
	 * @param picUrls
	 * @return
	 */
	public int updateEmployeeHeadPicUrl(@Param(value = "employeeId") int employeeId, @Param(value = "picUrls") String picUrls);

	/**
	 * 根据员工id获取头像路径
	 * 
	 * @param employeeId
	 * @return
	 */
	public String getHeadPicUrlByEmployeeId(@Param(value = "employeeId")int employeeId);

	/**
	 * 模糊查询云办公用户
	 * 
	 * @param map
	 * @return
	 */
	public List<Employee> getYunWorkEmployeeByCondition(Map map);
	
	/**
	 * 根据小区ID和用户姓名模糊字段查询用户信息
	 * 
	 * @param compoundsId
	 * @param dept 
	 */
	public List<Employee> queryEmployeesByCompoundsIdAndName(@Param(value = "compoundsId")int compoundsId, @Param(value = "name") String name, @Param(value = "dept") int dept);
	
	/**
	 * 根据小区ID和用户名查询用户信息
	 * 
	 * @param compoundsId
	 * @param name
	 * @return
	 */
	public List<Employee> queryEmployeesByCompoundsIdAndNameAll(@Param(value = "compoundsId")int compoundsId, @Param(value = "name") String name);

	/**
	 * 获取人脸数据
	 * 
	 * @param value
	 * @return
	 */
	public String getFaceData(Integer employeeId);
	
	/**
	 * 更新人脸数据
	 * 
	 * @return
	 */
	public int updateFaceDataById(@Param("employeeId")Integer employeeId, @Param("faceData")String faceData);

}
